package com.mk.legoscans2.data;

import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;

import android.sax.RootElement;
import android.util.Xml;

public abstract class SaxFeedParser {

	protected Boolean ExecuteParser(URL url, RootElement root)
	{
        try {
        	URLConnection connection = url.openConnection();
        	connection.setConnectTimeout(3000);
        	connection.setReadTimeout(6000);
        	InputStream is = connection.getInputStream();
            Xml.parse(is, Xml.Encoding.UTF_8, root.getContentHandler());
            is.close();
        } catch (Exception ex) {
            return false;
        }
        
        return true;
	}
}
